package com.mars.app.utils;

import com.mars.app.enumerate.Prefix;

import java.util.UUID;

/**
 * Created by pengshuo on 2018/1/3 15:37
 * Description:
 * Modified By:
 * Version:
 *
 * @author pengshuo
 */
public class UUIDUtil {

    /**
     * 获取 user uuid
     * @return
     */
    public static String userInfo(){
        return uuid(Prefix.UserInfo);
    }

    /**
     * 获取 rainbow message uuid
     * @return
     */
    public static String rainbow(){
        return uuid(Prefix.Rainbow);
    }

    /**
     * 获取 rainbow message uuid
     * @return
     */
    public static String ripple(){
        return uuid(Prefix.Ripple);
    }

    /**
     * 获取 think uuid
     * @return
     */
    public static String think(){
        return uuid(Prefix.Think);
    }

    /**
     * 获取 prefix + uuid
     * @param prefix
     * @return
     */
    protected static String uuid(Prefix prefix){
        return  prefix.getPrefix() + UUID.randomUUID().toString();
    }

}
